/*
 * Exploder
 * 
 * Tero Pyylampi (218437), Jussi Tuurinkoski (211594)
 *
 * Wooden box element for the game
 */

#ifndef GAMEELEMENTSTEELBOX_H
#define GAMEELEMENTSTEELBOX_H

#include "GameConstructionElement.h"

class GameElementSteelBox :
	public GameConstructionElement
{
public:
	// default constructor
	GameElementSteelBox( b2World *world, cocos2d::CCLayer *layer, GameCamera *camera, bool editingMode, b2Vec2 worldPos, ElementType properties, float rotation );
	// default destructor
	virtual ~GameElementSteelBox();

	// update function
	virtual void update( cocos2d::ccTime dt );

	// apply explosion force, the object itself should decide whether to break or not
	virtual void applyExplosionToElements( b2Vec2 sourcePos, float force );
	// change object sprite to broken
	virtual void changeSpriteToBroken();
	// break object into pieces
	virtual void breakObject();

	// get the main type of the object
	virtual PhysicObjectItems getObjectType();

protected:
	// init this object in editing mode
	void initObjectInEditingMode( b2Vec2 worldPos );
	// init this object in game mode
	void initObjectInGameMode( b2Vec2 worldPos, float rotation );
};

#endif

